<?php
/**
 * FAQ模型
 * 
 * @version $Id: Faq.php 493 2012-11-08 09:32:48Z linsir123 $
 */
class modelFaq
{
	/**
	 * @var 分类列表
	 */
	public $types = array(
		0 => '返现相关',
		2 => '提现相关',
	);
	
	/**
	 * 取得列表
	 */
	public function getList($type = 0)
	{
		if ( ! array_key_exists($type, $this->types)) 
			return array();
			
		///
		if (empty($type)) 
			$type = '';
			
		///
		$data = array();
		$file = APP_DIR ."Config/xml/faq{$type}.xml";
		$o = simplexml_load_file($file);
		if (isset($o->item)) {
			foreach ($o->item as $v) 
				$data[] = array(
					'title' => (string) $v->title,
					'body' => (string) $v->body,
				);
		}
		
		return $data;
	}
}
